import { Disease } from '../../types/disease'
import { Page, PageReq } from '../../types/page'
import { DiseaseDao } from '../dao/diseaseDao'

export class DiseaseService {
  /**
   * 创建疾病
   */
  static async create(disease: Omit<Disease, 'id'>): Promise<number | undefined> {
    return DiseaseDao.create(disease)
  }

  /**
   * 更新疾病信息
   */
  static async update(disease: Partial<Disease>): Promise<void> {
    return DiseaseDao.update(disease)
  }

  /**
   * 删除疾病
   */
  static async delete(id: number): Promise<void> {
    return DiseaseDao.delete(id)
  }

  /**
   * 获取疾病详情
   */
  static async getById(id: number): Promise<Disease | null> {
    return DiseaseDao.getById(id)
  }

  /**
   * 获取疾病列表
   */
  static async list(): Promise<Disease[]> {
    return DiseaseDao.list()
  }

  /**
   * 分页查询疾病列表
   */
  static async page(params: PageReq<Disease>): Promise<Page<Disease>> {
    return DiseaseDao.page(params)
  }
}